<template>
  <div>
    <el-row>
      <el-col :span="24">
        <p class="el-St">小U商城后台</p>
        <el-menu
          unique-opened
          :default-active="$route.path"
          class="el-menu-vertical-demo"
          background-color="#545c64"
          text-color="#fff"
          active-text-color="#ffd04b"
          router
        >
          <el-menu-item index="/">
            <i class="el-icon-setting"></i>
            <span slot="title">首页</span>
          </el-menu-item>
          <el-submenu index="2">
            <template slot="title">
              <i class="el-icon-setting"></i>
              <span>系统设置</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="/menu">菜单管理</el-menu-item>
              <el-menu-item index="/role">角色管理</el-menu-item>
              <el-menu-item index="/admin">管理员管理</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <el-submenu index="3">
            <template slot="title">
              <i class="el-icon-s-goods"></i>
              <span>商城管理</span>
            </template>
            <el-menu-item-group>
              <el-menu-item
                v-for="(item, index) in menuList"
                :key="index"
                :index="item.path"
                >{{ item.title }}</el-menu-item
              >
            </el-menu-item-group>
          </el-submenu>
        </el-menu>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  data() {
    return {
      menuList: [
        { title: "商品分类", path: "/category" },
        { title: "商品规格", path: "/specs" },
        { title: "商品管理", path: "/goods" },
        { title: "会员管理", path: "/member" },
        { title: "轮播图管理", path: "/banner" },
        { title: "商品秒杀", path: "/seck" },
      ],
    };
  },
  methods: {
    // handleOpen(key, keyPath) {
    //   console.log(key, keyPath);
    // },
    // handleClose(key, keyPath) {
    //   console.log(key, keyPath);
    // },
  },
};
</script>

<style>
.el-menu-vertical-demo {
  text-align: left;
}
.el-aside {
  background-color: rgb(84, 92, 100);
}

.el-menu-item.is-active {
  background-color: #fb6d49 !important;
  color: #fff !important;
}
.el-menu-item.is-active i {
  color: #fff !important;
}
.el-menu-item.is-active span {
  color: #fff !important;
}
.el-St {
  line-height: 60px;
  font-size: 20px;
  color: #fff;
  background-color: rgb(121, 119, 119);
}
</style>